<%@page import="com.hotel.test.service.LocalLocalServiceUtil"%>
<%@page import="com.liferay.portlet.PortletURLUtil"%>
<%@page import="com.hotel.test.service.HotelLocalServiceUtil"%>
<%@page import="com.hotel.test.service.persistence.HotelUtil"%>
<%@page import="java.util.Map"%>
<%@page import="javax.portlet.PortletRequest"%>
<%@page import="com.hotel.test.model.TblComment"%>
<%@page import="java.util.List"%>
<%@page import="com.hotel.test.service.TblCommentLocalServiceUtil"%>
<%@page import="com.hotel.test.model.Hotel"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ include file="/html/init.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="/css/main.css" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<%
String url = PortalUtil.getCurrentURL(request);
String localId = (String) request.getParameter("localId");

//PortletSession s = renderRequest.getPortletSession(true);
//Hotel hotel = (Hotel) s.getAttribute("hotel",PortletSession.PORTLET_SCOPE);
//String url = PortalUtil.getCurrentURL(request);


//List<TblComment> comments =  (List<TblComment>)s.getAttribute("comments",PortletSession.PORTLET_SCOPE);
	if(localId == null)
	{
		%>
		<h1 style="color:  red;"> Loi khong tim thay khach san </h1>
		<%
	}
	else
	{
		List<Hotel> hotels = HotelLocalServiceUtil.getByLocalId(Long.parseLong(localId));
		int size = hotels.size()>=5 ? 5 : hotels.size();
		Local local = LocalLocalServiceUtil.getLocal(Long.parseLong(localId));
		
		%>
			
			<h1 style="color: red"> <%=local.getLocalName() %></h1>
			<img alt="" src="<%=local.getImage() %>">
			<div class="local_introduce">
				<p><%=local.getIntroduce() %></p>
			</div>
			<hr>
			<h3>Cac Khach San Lan Can Dia Diem <%=local.getLocalName() %></h3>
			
			
			<table style="margin-top: 20px">
			<tr>
		<%
		for(int i = 0 ; i< size; i++)
		{
			
			%>
				<td class="img">		
				<a href="<%=url+"&hotelId="+hotels.get(i).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i).getImage()%>"/></a>
					<div class="desc">
							<a href="<%=url+"&hotelId="+hotels.get(i).getHotelId()%>"><%=hotels.get(i).getHotelName() %></a> 
					</div>	
				</td>
			<%
		}
	}
	
%>
			</tr>
			</table>

</body>
</html>